package com.zzx.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class LoginController {

	@RequestMapping("/login")
	public String login(String username,String password,HttpSession session) {
		//验证
		session.setAttribute("username", username);
		
		return "redirect:items/queryItems.action";
	}
	
	@RequestMapping("/logout")
	public String logout(HttpSession session) {
		session.invalidate();
		return "redirect:login.action";
	}
}
